<html xmlns="http://www.w3.org/1999/xhtml"><head><style type="text/css">
dt {
  font-style: italic;
  margin-top: 15px;
  margin-bottom: 3px;
  margin-left: 0px;
  border-bottom: 1px dotted black;
}
dd {
  margin-left: 10px;
}
table {
  border-collapse:collapse;
  border: 1px solid black;
  margin-top: 7px;
}
th {
  border: 1px solid black;
  padding: 3 7 3 7;
}
td {
  border: 1px solid black;
  padding: 3 7 3 7;
}
</style></head><body><p><a name="monitorexit"></a><b>monitorexit</b> :
  leave synchronized region of code : <a href="opcodes.html">index</a> : <a href="http://asm.objectweb.org/asm40/javadoc/user/org/objectweb/asm/MethodVisitor.html#visitInsn(int)">visitInsn()</a></p><dl><dt>Description</dt><dd>This releases an exclusive lock that was previously obtained using
monitorenter for the object <i xmlns="">objectref</i>. If other threads are
waiting for the object to become unlocked, one of the waiting threads will be
able to acquire a lock on the object and proceed.<br></br>Note that a single thread can lock an object several times - the runtime system
maintains a count of the number of times that the object was locked by the
current thread, and only unlocks the object when the counter reaches zero (i.e.
when the number of monitorenters and monitorexits applied to
a given object are equal). <br></br>The monitorenter/monitorexit mechanism is used by the Java
synchronized statement to coordinate access to an object among
multiple threads.</dd><dt>Exceptions</dt><dd>NullPointerException - <i xmlns="">objectref</i> is null. <br></br>IllegalMonitorStateException - <i xmlns="">objectref</i> was not previously locked by
the current thread.</dd><dt>See also</dt><dd><a href="ref-monitorenter.html">monitorenter</a> </dd><dt>Stack</dt><dd><table xmlns="">
<tr>
<td>
<b>Before </b>
</td>
<td><b>After</b></td></tr>
<tr>
<td>objectref</td>
<td>...</td></tr>
<tr>
<td>...</td>
<td>...</td></tr>
</table></dd><dt>Bytecode</dt><dd><table xmlns="">
<tr>
<td>
<b> Type </b>
</td>
<td><b>Description</b></td></tr>
<tr>
<td>u1</td>
<td>monitorexit
opcode = 0xC3 (195)
</td></tr>
</table></dd></dl></body></html>